﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace MyFace
{
    class Fades
    {
        
        float Fade = 255;
        int Timer = 0;
        int WaitTime = 120;

        public void Initialize()
        {

        }
        public void Update(GameTime gameTime)
        {
            FadeOut();
            if (Timer >= WaitTime)
                FadeIn();
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {

        }

        public float FadeOut()
        {
            Fade = 0;
            if (Fade < 255)
                Fade++;

            if (Timer < WaitTime)
                Timer++;

            return Fade;
        }

        public void FadeIn()
        {
            Fade = 255;
            if (Fade > 0)
                Fade--;
        }
    }
}
